package com.dzx.design.creational.singletonexample;

/**
 * @author dzx
 * @ClassName:
 * @Description:
 * @date 2019年07月15日 09:54:58
 */

/**
 * 懒汉式
 */
public class SingletonExample1 {

    private SingletonExample1() {
    }

    public static SingletonExample1 singletonExample1 = null;

    public static SingletonExample1 getInstance() {
        if (singletonExample1 == null) {
            singletonExample1 = new SingletonExample1();
        }
        return singletonExample1;
    }
}
